After completing this lesson, you’ll be able to:
In this lesson, you will:
FME allows tracking versions for external file definitions of custom transformers (linked transformers). Users can save a new version when they edit a custom transformer definition.
In that way, a single FMX file can contain multiple versions of the same custom transformer.
Versioning allows the author of a custom transformer to revert to a previous definition if needed. It also allows users to create a different definition for each version of FME. The custom transformer remains backward-compatible with older FME versions but has enhanced functionality in newer versions.
After editing an unversioned custom transformer, clicking the Save button issues the following prompt:

The two versioning options are to Overwrite the existing version or create a New Version.
Essentially, the prompt asks whether to activate versioning. Clicking New Version versions the transformer and saves the edits as version 2. Note that creating a new version does not create a separate FMX file; instead, it creates a different version of the transformer within the same FMX file.
The title bar in Workbench illustrates the version number of a custom transformer file:

The transformer remains unversioned if you choose Overwrite in the Save Transformer dialog.
Opening a versioned custom transformer in Workbench issues the following prompt:

This prompt asks which version you wish to edit or whether you want to start with a new version. You can:
It’s essential to know that this dialog is the only way to create a new version. Clicking the save button only saves updates to the currently open version. To create a new version, you must close and reopen the file, causing the Select Transformer Version dialog to appear.
Each version of a custom transformer is associated with a particular FME version. You can choose to make edits to a transformer created in an older version of FME, but you will receive a warning message:

Here, a user created version 1 with FME 2020, and the author is attempting to edit it in FME 2022. Should they proceed, version 1 of the transformer will no longer be valid for use in FME 2020.
Sometimes, you can get confused about these dialogs (well, I can), so let me set you straight:
When you first export a custom transformer, you don’t get the Select Version dialog (because the transformer is still unversioned). You also don’t get the Save Version dialog (because why create a new version when you just exported this transformer?)
When you open the definition (FMX file) the next time, you again don’t get the Select Version dialog (because it is still unversioned). But you will get the Save Version dialog when you save the changes, allowing you to make the transformer version.
From that point on, you’ll always get the Select Version dialog when you open the FMX file (because the transformer is now versioned), but for the same reason, you’ll never get the Save Version dialog when you save edits.
Suppose you turn on the option to display the transformer version (Utilities > FME Options > Workbench > Transformers > Display transformer version). In that case, each linked custom transformer displays its version number in the summary annotation:

When FME detects that a new version is available (i.e., the author has made edits and saved them as a new version) and that this version is compatible with the current FME version, then an option appears on the context menu to allow an update:

Choosing to upgrade means the transformer becomes linked to the latest version, and the summary annotation updates to reflect the change.
You can also upgrade eligible custom transformers in the Navigator, just like you upgrade FME transformers when moving to a new FME version. Custom transformers will appear under Upgradable Transformers, just like regular transformers. You can learn more about upgrading FME transformers in the documentation.

You can upgrade multiple transformers simultaneously. Learn more.

Sven has a working AverageLengthCalculator custom transformer, and he wants to use versioning so that every workspace using it can pick up his improvements. His workspace reads bike routes data and writes average route lengths. Before he shares the transformer with his team, he wants to add geometry filtering as a second version.
In this exercise, you will:
You will work in two Workbench sessions throughout this exercise, one for the workspace and one for the custom transformer definition. Keep both open so you can move between them.
Workbench can show the version number of every linked custom transformer in its summary annotation. With this option on, you can confirm which version an instance uses before and after you upgrade it.

A new instance of the AverageLengthCalculator links to the definition in the FMX file. Confirming which version it starts at makes the upgrade you do later easy to spot.

Let's make a real improvement to the transformer and save a new version. Filtering by geometry keeps the transformer from measuring the length of point features and other non-linear geometries.



The workspace still holds the version 1 instance you placed earlier. Refreshing the Transformer Gallery lets FME find the new definition so you can upgrade that instance.

